

using System.Data.SqlClient;
using System;
using System.Data;
namespace GeneralClasses{

///holds preferredTime and keeps track of it in the database

#region NOTES
/*
13 OCT 2010 - Created class, cant put it in so nothing is tested, still writing in notepadd++.
24 OCT 2010 - working on it, but cant tell if the sql statments work. this is the same thing as the availableTime class, so there really isnt any difference in how it works
*/
#endregion


public class deprecated_PreferredTime{

#region VARIABLES
//==============================================================================
//                                                                     VARIABLES
//==============================================================================

    private int pid;
private int personId;
private DayOfWeek dow;
private int startHour;
private int endHour;

    private DatabaseConnection dbc;

#endregion
#region PROPERTIES
//==============================================================================
//                                                                    PROPERTIES
//==============================================================================

    /*public string ConnectionString{
        get{return dbc.ConnectionString;      }
        set{dbc.ConnectionString=value;}
    }*/


    public int PID{
            get{return pid; }
        set{pid = value; }
    }

public int EndTime{
get{return endHour;}
set{endHour = value;}
}

public int StartTime{
get{return startHour;}
set{startHour = value;}
}

public DayOfWeek DayOfWeek{
get{return dow;}
set{dow = value;}
}

public int PersonID{
get{return personId;}
set{personId = value;}
}

#endregion

#region CONSTRUCTOR
//==============================================================================
//                                                                   CONSTRUCTOR
//==============================================================================

public deprecated_PreferredTime(){
personId=-1;
dow = new DayOfWeek();
startHour = 0; // fix this
endHour = 0; // fix this
}

#endregion 

#region PRIVATE

//==============================================================================
//                                                                       PRIVATE
//==============================================================================

private bool  checkPreferredTimeUsed(int ptid){return false;}


#endregion

#region PUBLIC
//==============================================================================
//                                                                        PUBLIC
//==============================================================================

    ///pulls all of the data for this object from the database
    ///, MAKE SURE THE AID IS SET BEFOREHAND
    public void loadData(){
      DataTable table = dbc.query("SELECT * FROM Preferredtime P WHERE P.pid = '" + pid + "'");
        //this.startHour = reader.GetInt32(1);  // hour, not day
        //this.endHour = reader.GetInt32(2);  // hour, not day
    }


public bool checkPreferredTime(DayOfWeek d, DateTime s, DateTime e){return false;}

	public void deleteDate(int dateID){
		/*if(!checkDateUsed(dateID)) {
			
		}*/
	}

	public void addPreferredTime(DayOfWeek d, DateTime s, DateTime v ){
		/*if(checkDate(dateTime)==false){
			DatabaseConnection dbc = new DatabaseConnection();
			dbc.Query="INSERT INTO D (d) VALUES('" + dateTime +"')";
		} // end if*/
	} // end addDate


#endregion

} // end class


} //end namespace